import Cookies from 'js-cookie'
import storeage from "store";
const TokenKey = 'Token';
const RefreshTokenKey = 'saber-refresh-token';
const UserHeadPic = 'saber-user-headPic';
const UserInfo = 'UserInfo';
const UserAuthority = 'UserAuthority';
const Config = 'Config';
const TenantInfo = 'TenantInfo';
const Entry = 'Entry'

export function getToken() {
    return Cookies.get(TokenKey)
}

export function setToken(token) {
    return Cookies.set(TokenKey, token)
}

export function getRefreshToken() {
  return Cookies.get(RefreshTokenKey)
}

export function setRefreshToken(token) {
  return Cookies.set(RefreshTokenKey, token)
}

export function removeToken() {
    return Cookies.remove(TokenKey)
}

export function removeRefreshToken() {
  return Cookies.remove(RefreshTokenKey)
}

export function setHeadPic(address) {
    return Cookies.set(UserHeadPic, address);
}

export function setUserInfo(userInfo) {
    return Cookies.set(UserInfo, userInfo);
}

export function getUserInfo() {
    return Cookies.get(UserInfo);
}

export function setUserAuthority(userAuthority) {
    return storeage.set(UserAuthority, userAuthority);
}

export function getUserAuthority() {
    return storeage.get(UserAuthority);
}

export function setEntry(entry) {
    return storeage.set(Entry, entry);
}

export function getEntry() {
    return storeage.get(Entry);
}

export function removeEntry() {
    return storeage.remove(Entry);
}

export function removeUserAuthority() {
    return storeage.remove(UserAuthority);
}

export function setTenantInfo(tenantInfo) {
    return storeage.set(TenantInfo, tenantInfo);
}

export function getTenantInfo() {
    return storeage.get(TenantInfo);
}

export function removeTenantInfo() {
    return storeage.remove(TenantInfo);
}

export function setConfig(config) {
    return storeage.set(Config, config);
}

export function getConfig() {
    return storeage.get(Config);
}

export function removeConfig() {
    return storeage.remove(Config);
}
